//
//  GoodChannelCell.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/29.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//

#import "GoodChannelCell.h"
#import "CommonMacro.h"
@interface GoodChannelCell ()
@property (nonatomic,strong) UIImageView *modulaImageView;
@property (nonatomic,strong) UILabel *titleLabel;
@property (nonatomic,strong) UILabel *detailLabel;
@property (nonatomic,strong) UIView *bgView;

@end
@implementation GoodChannelCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createGoodChannelSubview];
    }
    return self;
}

- (void)createGoodChannelSubview
{
    self.bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 4, SCREEN_WIDTH-20, 125)];
    self.bgView.backgroundColor = UIColorWithRGBA(255, 255, 255, 1);
    self.bgView.layer.cornerRadius = 5;
    self.bgView.clipsToBounds = YES;
    [self addSubview:self.bgView];
    self.bgView.layer.borderColor = UIColorWithRGBA(192, 192, 192, 1).CGColor;
    self.bgView.layer.borderWidth = 1;

    //1.图片
    self.modulaImageView = [[UIImageView alloc] initWithFrame:CGRectMake(3, 3, self.bgView.frame.size.width*0.4, self.bgView.frame.size.width*0.4)];
    [self.bgView addSubview:self.modulaImageView];
    self.modulaImageView.image = [UIImage imageNamed:@"俱乐部"];
    
    
    //2.标题
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.modulaImageView.frame.size.width+self.frame.origin.x+5, self.modulaImageView.frame.origin.y, self.bgView.frame.size.width*0.59, self.bgView.frame.size.height*0.25)];
    [self.bgView addSubview:self.titleLabel];
    self.titleLabel.text = @"宝宝睡状中藏着的健康密码";
    self.titleLabel.numberOfLines = 2;
    [self.titleLabel sizeToFit];
    self.titleLabel.textColor = UIColorWithRGBA(91, 91, 91, 1);
    self.titleLabel.font = [UIFont boldSystemFontOfSize:15];
    
    //3.详述内容
    self.detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.titleLabel.frame.origin.x, self.titleLabel.frame.size.height+self.titleLabel.frame.origin.y, self.titleLabel.frame.size.width, self.bgView.frame.size.height*0.2)];
    [self.bgView addSubview:self.detailLabel];
    self.detailLabel.textColor = UIColorWithRGBA(182, 182, 182, 1);
    self.detailLabel.text = @"很多新手妈妈都抱怨，宝宝一夜没有睡好，全家人跟着熬了一夜，又累又困。宝宝的睡眠质量可是头等大事，如果鲍勃啊睡得安静、舒坦、呼吸均匀，这样就是我们向往的“婴儿般的睡眠”";
    self.detailLabel.font = [UIFont systemFontOfSize:12];
    self.detailLabel.numberOfLines = 5;
    [self.detailLabel sizeToFit];
    
}

@end
